home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Almathera Ten Pack 3: CDPD 3
/
Almathera Ten on Ten - Disc 3: CDPD3.iso
/
fish
/
726-750
/
727
/
vertex
/
docs
/
multiply.doc
< prev
next >
Wrap
Text File
|
1995-03-18
|
11KB
|
270 lines
Multiply Document - Hints and tips on getting the most use out of Vertex's
multiply feature.
The multiply command lets you apply any mathematical formula to any set of
selected vertices. You are limited to affecting 1 axis at a time, ie.
either X=, Y= or Z=.
For the unitiated, this feature probably seems useless. "I don't know
anything about math - I'm an artist!", might be what your saying to
yourself. If this is the case, then I strongly urge you to read this
document. It will not explain the rules and details of mathematics, but it
will give you some formulas, with explainations, which could produce just
the effect your looking for.
Lets start by getting a feel for how the Multiply command works. With any
object selected, activate the Multiply command under the Modify menu. To
quickly erase the current formula, press and hold the right Amiga key,
then press the X key.
Now, enter the following formula:
X=X
(This may not look like a formula, but it is!)
Before pressing return, try to guess what will happen. Ask yourself, "What
is being changed." If you answered the X coordinate of all selected
vertices, then you are correct. Thats what the X= part of the formula
means. We will be assigning some value to the X coordinate of every
selected vertex. Now, ask yourself, "What are we assigning to the X
coordinate?"
Well, for this example, the answer is - the original X coordinate. The net
effect of this is that there will be no change to the object. We will be
assigning the original X coordinate to the new X coordinate. If your
saying, "Wow, thats pretty useless", your right. However, I wanted to get
the point across about how the axis on the left of the equation, the X=,
is what will be assigned a new value. And, this value is based on the
right hand side of the equation.
Now, lets take our example a little further. Lets alter our "useless"
equation into something we can use:
X=X*2
Examine this equation. Ask yourself, "What is being changed?" and "What is
it being changed to?" Lets run through it.
We are changing the X coordinate (I hope this is clear now). Now, how are
we changing the X coordinate? We are taking the original X coordinate and
multiplying it by a factor of 2. So, every selected vertices X coordinate
will be doubled. If your think this sounds alot like a scale command, you
are right. This particular formula will double the width, or X axis, of an
object. If we did this in the traditional 3D object editor, we would use
the scaling command, and enter a value of 2 for the X axis. True, Vertex
has a scale command and this is not that "useful" of a function, but it
does open up some new possibilities.
Lets take our example a quantum leap forward. Examine this formula, and
try to figure out what will happen:
X=X+Y
Again, we will be affecting the X axis, as shown by the X= in the
equation. Now we must ask, "What is the X axis being changed to?"
We will be taking the X coordinate of the vertex and adding the Y
coordinate to it. Do you know what this will produce? I'd highly suggest
trying it now, as I'm sure you can find it useful.
If you have tried it, you will see that this is a "shear" command. With it
we can tilt a 3D object, or make 3D text italic. Pretty neat, eh? We have
only just begun to make use of the Multiply command.
==========================================================================
After playing with simple addition and multiplication of vertices, you
will prbably discover most of the functions under the Transform Menu:
Move, Scale and Size.
With the addition of some simple trig formulas, we can open a whole new
world of math. Please, don't be intimidated by the trig formulas - we will
not be talking about theory! We will be giving you some useful examples of
actually using the functions.
Lets start with Cosine. Cosine is a trig function, and it is pretty
useful. It will return a value between -1 and 1. This value will be
circular, or wavy. The COS function should look like this:
COS( X ) or COS( Y ) or COS( Z )
Notice how there is COS, then an opening parenthesis, then a letter
representing an axis, then a closing parenthesis. The letter of the axis
is important, if we simply put a number in there, say COS( 10 ), we would
always get the same result. When we put an axis in the middle of the
parentheses, we get a varying, or wavy, result.
We can use it to map a wave onto an object:
Z=cos(x)
Lets take a minute to talk about the function before we really try it out.
First, it should be obvious that we are affecting, or changing, the Z axis
of the object. Now, we ask "What is the Z axis is being changed to?" The Z
axis will be assigned the COS of the value of the X coordinate. As the X
coordinate changes, the Z coordinate will be the COS of that x coordinate.
If this is confusing, (it is very difficult to explain with words), don't
worry - we'll look at an example.
If we used the formula Z=cos(x), we will probably be a little
disappointed. The object will look rather flat after applying the formula.
The reason is that we changed the Z coordinate to be the cosine of the X
coordinate. The cosine function only returns values between -1 and 1. To
fix this we need to change the formula a bit:
Z=cos(x)*20
Now that we've added the *20 to the equation, we will scale the new Z
coordinate by 20. Type in this example, and check out the effect. (Make
sure you have some vertices selected!)
The *20 is considered a scaling factor, or the amplitude. In this case,
the Z coordinate will have coordinates any where from -20 to +20. So, by
changing this value, we can change the size of the waves.
Before we leave the cosine function, lets talk about 1 more thing -
frequency. The frequency can be explained as the number of bumps, or high
points, in a cosine wave.
** **
*** ***
** **
* *
* *
* *
* * = Frequency of 1
* *
* *
** **
*** ***
****
To change the the frequency of a wave, we must scale the input. Here's an
example:
Z=cos(x * 2)*20
Now we've changed our cosine formula to create twice as many high
points, or complete waves, in the object. If you tried the cosine example,
and found it gave you too few waves, then you can experiment with this
scaling factor to increase the number of waves in the object.
So, here is, finally, a really useful example. You now have the ability to
make waves in your objects!
To help you along, here are some hints/tips on using the cosine function:
. The size of the original object is very important. You can use the
same formula on 2 objects of different sizes, and get very different
results.
. If you object is centered on the origin, then you will get symmetrical
results. Try moving the object on any axis before applying the
formula, and see what you get.
. Fairly large objects with few vertices, may result in a rather poor
effect. If this is a problem, try subdividing the object, or scaling
it down.
. Don't hesitate to experiment! You may come up with some real
interesting results just by changing the formula a little bit.
==========================================================================
SIN is a trig function, as is cosine. In fact it is very similar to
cosine, except the high point of the sine wave is the low point of the
cosine wave.
To see the effect of this difference, create an object, (a grid works the
best), and apply the following formula:
Z=sin(x*2)*30
After this function returns, you will see an effect similar to the COS
example above. Now, duplicate the object with Add-Duplicate, and apply
this formula to the duplicated object:
Z=cos(x*2)*30
You will see how the waves are the mirror image of each other, across the
Z axis.
==========================================================================
Now, lets try something really unique. Create a basic grid, say with
a resolution of 10 x 10.
How can we make a wave through this grid which eminates from the
center of the grid? Rather like a ripple in a pond?
Here's how to do it with our basic grid. The formula is a little
complicated, but I'll show you the important parts you can change to
create more or less waves and taller or shorter waves.
Z=cos(sqr(x*x+y*y)*10)*20
This is the basic version of the formula. You will notice "normal"
numbers, 10 and 20. The 10 is the input scaling factor, just like in
the COS example above. The second number is the scaling factor, as it
is above. Try this example to see the results.
Now, lets say we wanted to create a waving animation. This formula
will work fine, except for one thing.
We need to "move" the waves as a function of time. Here's how it's
done - use the offset in these formulas:
Z=cos(sqr(x*x+y*y)*10+0)*20
Z=cos(sqr(x*x+y*y)*10+20)*20
Z=cos(sqr(x*x+y*y)*10+40)*20
Z=cos(sqr(x*x+y*y)*10+60)*20
Z=cos(sqr(x*x+y*y)*10+80)*20
Z=cos(sqr(x*x+y*y)*10+100)*20
etc...
Each time we apply a formula, save the object, then apply the next
formula, etc. As we add the ever increasing values to the formula, we
will get waves which move along. You can change the amount to add
depending on how many frames of the animation you want. Keep in mind,
you must complete 360 degrees with these offsets to make a full,
looping animation:
Z=cos(sqr(x*x+y*y)*10+0)*20
Z=cos(sqr(x*x+y*y)*10+20)*20
Z=cos(sqr(x*x+y*y)*10+40)*20
Z=cos(sqr(x*x+y*y)*10+60)*20
Z=cos(sqr(x*x+y*y)*10+80)*20
Z=cos(sqr(x*x+y*y)*10+100)*20
Z=cos(sqr(x*x+y*y)*10+120)*20
Z=cos(sqr(x*x+y*y)*10+140)*20
Z=cos(sqr(x*x+y*y)*10+160)*20
Z=cos(sqr(x*x+y*y)*10+180)*20
Z=cos(sqr(x*x+y*y)*10+200)*20
Z=cos(sqr(x*x+y*y)*10+220)*20
Z=cos(sqr(x*x+y*y)*10+240)*20
Z=cos(sqr(x*x+y*y)*10+260)*20
Z=cos(sqr(x*x+y*y)*10+280)*20
Z=cos(sqr(x*x+y*y)*10+300)*20
Z=cos(sqr(x*x+y*y)*10+320)*20
Z=cos(sqr(x*x+y*y)*10+340)*20
Also remeber not to use +360 again, since 360 degrees is the same as
0 degrees - we would end up with an ugly "bump" in our animation.
This is the perfect kind of thing for Arexx. Create your object, and
save it. Apply the first formula, and save your object with a
different name. UNDO the multiply (saving is not UNDOable, so the
last function you performed, multiply, will be undone. Do the next
formula, etc.
Good luck,
Alex DeBurie